package libary;

public class Main {
    public static void main(String[] args) {
        Book[] books = new Book[]{
               new AdultBook("半小时漫画中国史"),
               new AdultBook("博弈论"),
               new KidBook("法布尔昆虫记"),
               new KidBook("最好的朋友"),
               new Literature("世界文化遗产"),
        };
        Customer customer = new Customer();
        int borrowingDays = 15;
        double fines = customer.calTotalFines(books,borrowingDays);
        System.out.println("您总共归还书籍"+books.length+"本：");
        for (int i=0;i< books.length;i++){
            System.out.println((i+1)+" "+books[i].getName());
        }
        System.out.println("借阅时间："+borrowingDays+"天");
        if (fines > 0){
            System.out.println("共需缴纳罚金："+fines);
        }
    }
}
